package com.wang.util;

import java.io.File;

public class Configure {

    public static String getUppath() {
        if(first)
           init();
        return uppath;
    }

    public static void setUppath(String uppath) {
        Configure.uppath = uppath;
    }

    public static String getOutPath() {
        if(first)
            init();
        return outPath;
    }

    public static void setOutPath(String outPath) {
        Configure.outPath = outPath;
    }



    public static void init() {


        File outdir = new File(outPath);
        if (!outdir.exists()) {
            outPath = "d:\\upload";
        }

        File updir = new File(uppath);
        if (!updir.exists()) {
            uppath = "d:\\upload";
        }
        System.out.println("Server init setting...");
        System.out.println("uppath:"+uppath);
        System.out.println("outPath:"+outPath);
        first=false;
    }
    private static String uppath = "/home/ai/jupyter/wangmin/keras-yolo3-master/tempfile";   //图片和视频文件上传后的临时路径
    private static String outPath = "/home/ai/jupyter/wangmin/keras-yolo3-master/outfile" ;       //视频文件识别后的结果路径

    public static String getAppPath() {
        return appPath;
    }

    public static void setAppPath(String appPath) {
        Configure.appPath = appPath;
    }

    public static boolean isFirst() {
        return first;
    }

    public static void setFirst(boolean first) {
        Configure.first = first;
    }

    private static String appPath = "/home/ai/jupyter/wangmin/app" ;

    private static boolean first=true;
}
